import requests
import re
import json
from fake_useragent import UserAgent
ua = UserAgent()



url_login = 'https://www.gying.org/user/login/'
s = requests.session()
s.post(url_login ,data={"username":"zzf1234","password":"Zzf0904.","siteid":1,"dosubmit":1,"cookietime":10506240})



headers = {"referer":"https://www.gying.org/",
           "user-agent":ua.random,

}

url = 'https://www.gying.org/'
res = s.get(url)
# print(res.text)

items = re.search(r'_obj.inlist=(.*?);',res.text).group(1)
items = json.loads(items)

titles = items[0]['t']
i_s = items[0]['i']
print(titles)
print(i_s)
for i in range(0,len(titles)):
    item = titles[i]
    i =f'https://www.gying.org/mv/{i_s[i]}'
    print(i)
    response = s.get(i,headers=headers)
    print(response.text)
    s.post(i,headers=headers,data={'t.d.fa':1} )

    break